/* 
 *	Copyright (C) 2009-2010 miaohua
 *	http://code.google.com/p/lrcshower/
 *
 *  This Program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *   
 *  This Program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with GNU Make; see the file COPYING.  If not, write to
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */

#pragma once
#include "TypeDef.h"
#ifndef ULONG_PTR
#define ULONG_PTR unsigned long*
#endif
#include <gdiplus.h>      
using namespace Gdiplus; 

// Parameters holder struct for color setting window
struct ClrSelParam
{
     ClrSelParam();
     // Properties for color setting window
     bool m_IsFocus;                        // Indicates current color setting window is for focus color or unfocus color
     bool m_IsDirty;                        // Wether the data is dirty 
     const TCHAR * m_ClrSetWinTitle;        // The Title for color seting window
     static const TCHAR * m_FocusWinTitle;  // The const title for focus color set window
     static const TCHAR * m_UnFocusWinTitle;// The const title for unfocus color set window
};

// The lrc show filter properties setting class
class CLrcShowFilterDesktopProperties : public CBasePropertyPage
{
public:

    static CUnknown * WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT *phr);
    DECLARE_IUNKNOWN;

private:

    BOOL OnReceiveMessage(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
    static BOOL CALLBACK ClrDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
    static SIZE GetLrcBoxSize(const tstring & Line, int Size, int Style);

    HRESULT OnConnect(IUnknown *pUnknown);
    HRESULT OnDisconnect();
    HRESULT OnActivate();
    HRESULT OnApplyChanges();
    void SetDirty();

    // Controls initialization
    void InitializeCtrls(HWND wnd);

    // Set property functions
    void SetKaraokeMode();
    void SetShadowMode();
    void SetOutlineMode();
    void SetTopMostMode();
    void SetWinTransMode();
    void SetLrcFile(HWND hwnd);
    void SetFont();
    void SetBgColor(HWND hwnd);
    void SetBgTrans();
    void SetLrcTrans();
    void SetFocusClr();
    void SetUnFocusClr();

    // Constructor & Deconstructor
    CLrcShowFilterDesktopProperties(LPUNKNOWN lpunk, HRESULT *phr);
    ~CLrcShowFilterDesktopProperties();

    HWND m_KaraokeChkbox;                 // The handler of Karaoke show mode check box control
	HWND m_ShadowChkbox;                  // The handler of Gradient show mode check box control
    HWND m_OutlineChkbox;                 // The handler of Outline show mode check box control
    HWND m_TopMostChkbox;                 // The handler of topmost show mode check box control
    HWND m_WinTransChkbox;                // The handler of window transparent show mode check box control
    HWND m_BgTransCtl;                    // The handler of background transparent control
    HWND m_LrcTransCtl;                   // The handler of lrc transparent control
    ILrcShowFilter*  m_ILrcShowFilter;    // Lrc Show Filter property interface
    ///Gdi plus startup parameters
    GdiplusStartupInput m_GdiplusStartupInput;
    ULONG_PTR           m_GdiplusToken;
};

